package routers
/*********************************************************/
/*********************本文档为路由数据表********************/
/***********************User的数据结构*********************/
/*********************version:1.0*************************/
/****Copyright (c) 2014年 许剑华. All rights reserved******/
/*********************************************************/
import (
	"smart_home/controllers"
	"github.com/astaxie/beego"
	//"github.com/beego/admin"  //admin 包
)

func init() {
	//主页
    //beego.Router("/", &controllers.MainController{})//主页
	beego.Router("/api/test", &controllers.UserGroup{},"*:Test")
	beego.Router("/api/test2", &controllers.UserGroup{},"*:TestFloat")


    /************************api相关****************************/
	//用户注册
	beego.Router("/api/register", &controllers.UserGroup{},"post:Register")
	//用户登入
	beego.Router("/api/login", &controllers.UserGroup{},"post:Login")
	//用户数据同步操作的UI
	beego.Router("/api/sync", &controllers.UserGroup{},"post:GetSyncDataList")
	//用户获取同步数据
	beego.Router("/api/getdata", &controllers.UserGroup{},"post:GetData")
	//用户上传
	beego.Router("/api/upload/:id", &controllers.UserGroup{},"post:UploadData")
	//用户更新遥控的数据
	beego.Router("/api/update_remote/:id", &controllers.UserGroup{},"*:UpdateRemoteData")
	//获取验证码
	beego.Router("/api/get_verify_code", &controllers.UserGroup{},"post:GetVerifyCode")
	//获取验证码
	beego.Router("/api/check_verify_code", &controllers.UserGroup{},"post:CheckVerifyCodeType")
	//更新用户的数据
	beego.Router("/api/update_user", &controllers.UserGroup{},"post:UpdateUser")
	//分享用户的遥控数据
	beego.Router("/api/share_remote", &controllers.UserGroup{},"post:ShareRemote")
	//搜索的遥控数据
	beego.Router("/api/search_remote", &controllers.UserGroup{},"post:SearcShareRemote")
	//获取分享用户的数据
//	beego.Router("/api/get_share_remote", &controllers.UserGroup{},"post:GetShareRemote")
	//获取匹配的遥控数据
	beego.Router("/api/get_match_remote_data", &controllers.UserGroup{},"*:GetMatchRemoteData")
	//下载用户分享的遥控数据
	beego.Router("/api/download_share_remote", &controllers.UserGroup{},"post:DownLoadShareRemote")
	//设置开关的状态
	beego.Router("/api/set_switch", &controllers.DeviceController{},"post:SetSwitch")
	//查询开关的状态
	beego.Router("/api/check_switch", &controllers.DeviceController{},"post:CheckSwitch")
	//控制红外开关的状态
	beego.Router("/api/set_remote", &controllers.DeviceController{},"post:SetRemote")
	//beego.Router("/api/set_ip", &controllers.DeviceController{},"post:SetIP")
	//用户设置是否开启机器自动控制
	beego.Router("/api/auto_control", &controllers.DeviceController{},"post:IsOpenMashineLearn")
	//获取红外设备测得的温度和湿度
	beego.Router("/api/get_temperature_and_humidity", &controllers.DeviceController{},"post:GetTemperatureAndHumidity")
	beego.Router("/api/get_temperature", &controllers.DeviceController{},"post:GetTemperatureAndHumidity")

	//测试用
	beego.Router("/api/Test_verify_code", &controllers.AdminController{},"get:Test_verify_code")
	beego.Router("/api/TestRemoteData", &controllers.UserGroup{},"*:TestRemoteData")
	beego.Router("/api/get_last_version", &controllers.UserGroup{},"*:GetLastVersionApp")
	beego.Router("/api/download_app/:id", &controllers.UserGroup{},"*:GetDownLoadAPP")


//帮助相关
	//常见问题的说明
	beego.Router("/api/common_problem", &controllers.HelpController{},"*:CommonProblem")
	//产品在线说明书
	beego.Router("/api/online_specification", &controllers.HelpController{},"*:OnlineSpecification")
	beego.Router("/api/online_remote_specification", &controllers.HelpController{},"*:OnlineRemoteSpecification")
	beego.Router("/api/online_switch_specification", &controllers.HelpController{},"*:OnlineSwitchSpecification")
	beego.Router("/api/online_vedio", &controllers.HelpController{},"*:OnlineVedio")
//关于我们
	beego.Router("/api/about_us", &controllers.AboutController{},"*:AboutUs")
//反馈信息
	beego.Router("/api/send_feedback", &controllers.FeedBackController{},"*:FeedBackMsg")




//管理员控制相关
	//管理员登入
	beego.Router("/admin/login", &controllers.AdminController{},"*:Login")
	//管理员登出
	beego.Router("/admin/login_out/:tel", &controllers.AdminController{},"*:LoginOut")
	//登入的首页
	beego.Router("/admin/index/:tel", &controllers.AdminController{},"get:Index")

	//监控设备
	beego.Router("/admin/supervisory_device", &controllers.AdminController{},"get:SupervisoryOnlineDevice")
	//显示设备控制的记录
	beego.Router("/admin/show_device_con_log/:tel", &controllers.AdminController{},"get:ShowDeviceConLog")
	//用户关于系统y设置的页面
	beego.Router("/admin/sys_setting/:tel", &controllers.AdminController{},"get:SysSetting")

	//获取返回用户的列表的页面
	beego.Router("/admin/admin_list/:tel", &controllers.AdminController{},"get:AdminList")
	//添加官方遥控的遥控页面
	beego.Router("/admin/add_remote_data/:tel", &controllers.AdminController{},"get:AddRemoteData")
	//更新官方遥控的遥控数据
	beego.Router("/admin/update_remote/:tel/:obj_id", &controllers.AdminController{},"*:UpdateRemoteData")
	//查看所有遥控器的信息
	beego.Router("/admin/show_remote_list/:tel", &controllers.AdminController{},"get:GetRemoteList")

	//ajax相关
	//获取用户的列表
	beego.Router("/admin/api/get_admin_list/:tel", &controllers.AdminController{},"get:GetAdminList")
	//获取验证码
	beego.Router("/admin/api/get_verify_code/", &controllers.AdminController{},"post:AdminTelVerifyCode")
	//验证验证码
	beego.Router("/admin/api/check_verify_code/", &controllers.AdminController{},"post:CheckVerifyCode")
	//验证验证码
	beego.Router("/admin/api/save_particle_size/:tel", &controllers.AdminController{},"post:SaveParticleSize")
	//保存自动控制的阀值
	beego.Router("/admin/api/save_threshold/:tel", &controllers.AdminController{},"post:SaveThreshold")
	//保存是否开启机器自动控制的标志
	beego.Router("/admin/api/save_machine_learn/:tel", &controllers.AdminController{},"post:SaveMahineLearn")
	//获取官方遥控的遥控数据列表
	beego.Router("/admin/api/get_remote_list/:tel", &controllers.AdminController{},"get:GetRemoteListJson")
	//获取官方遥控的遥控数据
	beego.Router("/admin/api/get_remote_detail/:tel/:obj_id", &controllers.AdminController{},"get:GetRemoteData")
	//增加遥控器数据
	beego.Router("/admin/api/del_remotes/:tel", &controllers.AdminController{},"post:DelRemotes")
	beego.Router("/admin/api/search_remote/:tel/", &controllers.AdminController{},"get:SearchRemote")
	//获取在线设备的数量
	beego.Router("/admin/api/online_devices/:tel/", &controllers.AdminController{},"get:OnlineDevices")
//	beego.Router("/admin/api/update_remote/:obj_id", &controllers.AdminController{},"*:UpdateRemoteData")
	//管理员更新数据
	beego.Router("/admin/api/update_admin/:tel", &controllers.AdminController{},"post:UpdateAdmin")


	beego.Router("/admin/api/add_remote_data/:tel", &controllers.AdminController{},"post:AddRemoteData")
	//设置设备控制的时间粒度
	beego.Router("/admin/set_particle_size/:tel", &controllers.AdminController{},"post:SetParticleSize")
	//删除管理员
	beego.Router("/admin/api/del_admin/:tel", &controllers.AdminController{},"post:DeleteAdmin")
	//删除多个管理员
	beego.Router("/admin/api/del_admins/:tel", &controllers.AdminController{},"post:DeleteAdmins")
	//增加管理员
	beego.Router("/admin/api/register/:tel", &controllers.AdminController{},"*:Register")
	//管理员上传新的app
	beego.Router("/admin/api/upload_new_app/:tel", &controllers.AdminController{},"post:AddNewApp")

	beego.Router("/admin/upload_new_app/:tel", &controllers.AdminController{},"get:AddApp")

	beego.Router("/admin/api/get_app_list/:tel", &controllers.AdminController{},"get:GetAppList")
	beego.Router("/admin/app_list/:tel", &controllers.AdminController{},"get:AppList")
	beego.Router("/admin/api/del_apps/:tel", &controllers.AdminController{},"post:DelAppList")

	//终端设备控制相关
    //beego.Router("/ws", &controllers.WebSocketController{})
    beego.Router("/ws/join", &controllers.WebSocketController{}, "get:DeviceJoin")
	//beego.Router("/json", &controllers.Jsontest{})
}
